import React, {
  Component
} from 'react'
import ReactDOM from 'react-dom/client'
import PropTypes from 'prop-types'
import Header from './containers/Header.js'
import Content from './containers/Content.js'
import { Provider } from 'react-redux'
import {
  createStore
} from 'redux'
import './index.css'
const themeReducer = (state, action) => {
  if (!state) {
    return {
      themeColor: 'red'
    }
  };
  switch (action.type) {
    case 'CHANGE_COLOR':
      return {
        ...state, themeColor: action.themeColor
      }
      default:
        return state
  }
}
const store = createStore(themeReducer);
class Index extends Component {
  render() {
    return ( <Provider store={store}>
      <Header/>
      <Content/>
      </Provider>
    )
  }
}
let root = ReactDOM.createRoot(document.getElementById('root'));
root.render( <Index/>)